<template>
	<view>
		<view class="success">
			<image src="/static/success.png" alt=""></image>
			<view class="title">支付中</view>
			<view class="btnBox">
				<view style="padding-right: 20rpx;">
					<u-button type="primary" :plain="true" :hairline="true" text="返回商户"></u-button>
				</view>
				<view style="padding-left: 20rpx;">
					<u-button type="success" :plain="true" @click="pay" :hairline="true" text="立即支付"></u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		// onLoad(opt) {
		// 	if(opt.type=="pay"){
		// 		this.isPay = true
		// 	}
		// },
		mounted() {},
		data() {
			return {

			};
		},
		methods: {
			navBack() {
				uni.navigateBack()
			},
			pay(){
				my.tradePay({
					// provider: 'alipay',
					"tradeNO": "2025021322001414431448719778",
					// orderInfo: {},//微信、支付宝订单数据 【注意微信的订单信息，键值应该全部是小写，不能采用驼峰命名】
					success: function(res) {
						uni.navigateTo({
							url: '/pages/paySuccess/paySuccess?pay=pay'
						})
						// //console.log('success:' + JSON.stringify(res));
					},
					fail: function(err) {
						// //console.log('fail:' + JSON.stringify(err));
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.success {
		padding-top: 240rpx;
		// margin-bottom: 120rpx;
		text-align: center;

		image {
			width: 160rpx;
			height: 160rpx;
			margin-bottom: 40rpx;
		}

		.title {
			font-weight: 600;
			font-size: 40rpx;
			padding-top: 20rpx;
		}

		.btnBox {
			width: 100%;
			padding: 40rpx 0;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>